﻿@inject IMessageService _MessageService;
@implements IDisposable
<div class="top-row ps-3 navbar navbar-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="">中北百事通<span style="color:#ffffff00">AAAAA</span></a>
        <Button Style="background-color:rgb(0,0,0,0);border: 0px solid #ff0e0e;color:white" OnClick="()=>{usr_set=!usr_set;}">
            @if (usr_set == true) {
                <img class="ShowIconFixed" src="/Resources/Icons/图钉-固定.svg" width="15" />
            } else {
                <img class="ShowIconFixed" src="/Resources/Icons/图钉-松开.svg" width="15" />
            }
        </Button>
        <span class="navbar-toggler">
            <Avatar Src="@("ImgsReq/"+GobalManager.myInfo?.Avatar_Name)" />
            <Button @onclick="ToggleNavMenu" Style="background-color: #00000057;">
                <span class="navbar-toggler-icon"></span>
            </Button>
        </span>
    </div>
</div>
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu" @onmouseenter="(e)=>{mouse_set=true;}" @onmouseleave="(e)=>{mouse_set=false;}">
    <div class="customShow @ShowBackGround">
        <nav class="flex-column">
            @{

            }
            <div class="nav-item px-3 @ShowFlex">

                <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                    <div style="width:100%">
                        <span class="oi oi-home" aria-hidden="true"></span> 主页
                    </div>
                </NavLink>

            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="LeaveIndex">
                    <div style="width:100%;">
                        <span class="oi oi-task" aria-hidden="true"></span> 请假管理
                    </div>
                </NavLink>
            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="PeopleMoveIndex">

                    <div style="width:100%">
                        <span class="oi oi-people" aria-hidden="true"></span> 人事调动
                    </div>


                </NavLink>
            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="WOMIndex">

                    <div style="width:100%">
                        <span class="oi oi-shield" aria-hidden="true"></span> 加班管理
                    </div>


                </NavLink>
            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="WorkManagerIndex">

                    <div style="width:100%">
                        <span class="oi oi-list-rich" aria-hidden="true"></span> 考勤管理系统
                    </div>


                </NavLink>
            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="SalaryManagerIndex">

                    <div style="width:100%">
                        <span class="oi  oi-yen" aria-hidden="true"></span> 资薪管理系统
                    </div>


                </NavLink>
            </div>

            <div class="nav-item px-3 @ShowFlex">
                <NavLink class="nav-link" href="Author">
                    <div style="width:100%">
                        <span class="oi oi-person" aria-hidden="true"></span> 我的
                    </div>


                </NavLink>
            </div>

        </nav>
    </div>
</div>

@code {
    private bool collapseNavMenu = true;
    bool mouse_set = false, usr_set = false;//鼠标设定 和 用户设定
    private bool showFlex { get { return mouse_set | usr_set; } } // 是否展示画面

    private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
    private string? ShowFlex => showFlex ? "allow-visable" : null;
    private string? ShowBackGround => showFlex ? "active-customShow" : null;

    private void ToggleNavMenu() {
        collapseNavMenu = !collapseNavMenu;
    }
    private void MouseEnter() {
        _MessageService.Info("您好");
    }
    protected override void OnInitialized() {
    }
    public void Dispose() {
    }
}
